UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aT8zoaCUTXJk5vgs7X/laglwf2LWNnhsyoU77xQcJjc='
WHERE
key_id = 'e81d3b393ae86fd4ead9e6c12f3127b9908b2492af749ec1f39b6d44b9ab1d71'
AND (
token = 'aT8zoaCUTXJk5vgs7X/laglwf2LWNnhsyoU77xQcJjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)