UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AsjKDEakkN5NtggjvP2RcXcAg8X8V72I0rhWzppjQn8='
WHERE
key_id = '2acf60fb2e014b4f7dfcdd2b6e26c4ea00e8699547fbf5bb2a598c39156a8414'
AND (
token = 'AsjKDEakkN5NtggjvP2RcXcAg8X8V72I0rhWzppjQn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)