UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lH0orFRQkpwpX2VibXC9JSC1xKSHmnGOXyhaOu1IIFY='
WHERE
key_id = 'bbb02e7370e6f81962a39061d16e9d887fdb697f612d254f179f7e1ff176b297'
AND (
token = 'lH0orFRQkpwpX2VibXC9JSC1xKSHmnGOXyhaOu1IIFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)