UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9uSKBswIgsYy+22MiEUsYH9McKJ0zVCFqo1W49xk8ko='
WHERE
key_id = '11804a7402e6c0d333133c738f72e83fd2c9c8d0b8eb71b2bac21482dabb36e1'
AND (
token = '9uSKBswIgsYy+22MiEUsYH9McKJ0zVCFqo1W49xk8ko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)