UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2hc8e46aQZ7W9diSLRoPKSoMGTxjYo09DBdi+4bi4MA='
WHERE
key_id = '611006e39c4603a019c1555c55d25be9f9130f601b8a59c647e2803c903199e9'
AND (
token = '2hc8e46aQZ7W9diSLRoPKSoMGTxjYo09DBdi+4bi4MA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)