UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nDrSAJcqeJAnbxCjs1cPgJWfpvoD64I5t0Saxh8cbMk='
WHERE
key_id = '47fbf00571de67ce0b631c83d5e39dfb4bd0cda446747b9bcb09763bb525ea25'
AND (
token = 'nDrSAJcqeJAnbxCjs1cPgJWfpvoD64I5t0Saxh8cbMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)