UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MxJ0JmCSIHieIm8+i0gSUhZwmtJy+KgYorvDntHxE10='
WHERE
key_id = '98fa1ad426ea207180dd88260fc48697f0294e8e28f8b5042b866692c5f9e918'
AND (
token = 'MxJ0JmCSIHieIm8+i0gSUhZwmtJy+KgYorvDntHxE10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)