UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ul+6AU9kxMv2UDut129kLXxqU6X5s8ZwvBCeEAuKSko='
WHERE
key_id = 'd4a6417440102ace6ae0687865ad4ba692a0c18cd70990e11b884366ab8f88f4'
AND (
token = 'ul+6AU9kxMv2UDut129kLXxqU6X5s8ZwvBCeEAuKSko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)