UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '31WucVITA0S0n/fHconkEOKkbcetSpcSUef3hRdOBUA='
WHERE
key_id = 'f96d855d2ead8522db771d92dd8f46f237c187e3b94f9d7728b54b7e8e40d4ab'
AND (
token = '31WucVITA0S0n/fHconkEOKkbcetSpcSUef3hRdOBUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)