UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTv8o8T00lWWu0rhw4ShWDt2K0RBZg0re9xcMNs/5iY='
WHERE
key_id = '6082377b3651ffdbf77f6050eeaf949818158c31cd5989c2391e55d37aeab5c6'
AND (
token = 'wTv8o8T00lWWu0rhw4ShWDt2K0RBZg0re9xcMNs/5iY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)