UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LApWIZs/8AnVab3nyL4NFJAQjVMvK3ZpF2jHs2sWmwE='
WHERE
key_id = '269cced798239b80d7f6db6ffba9758086fe00689da57f8e6ae8a59ac570b64e'
AND (
token = 'LApWIZs/8AnVab3nyL4NFJAQjVMvK3ZpF2jHs2sWmwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)