UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bIjBIwdVN7ZCRZncSLqP/d3GYjlUJICtJmangAKTscs='
WHERE
key_id = '6dad2113a5ab08fa9c139040bb972dba5aad7305b0c2ce00d5909c44a6b37b0c'
AND (
token = 'bIjBIwdVN7ZCRZncSLqP/d3GYjlUJICtJmangAKTscs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)