UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kB1ncDddHTPSKDvMU77BFbmlkuVKWhtcWw08WMz7uo='
WHERE
key_id = '3c925cf11bd0fadb31312b6dec25e5d1420032ce80fc62c70a09863000483b2c'
AND (
token = '0kB1ncDddHTPSKDvMU77BFbmlkuVKWhtcWw08WMz7uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)