UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anxdXNj2EkJLYxpwSM0pFz9gDq7gnBjxmbtpMTsUN3U='
WHERE
key_id = '7ea9caa48922020516e035ae8bb352fcc99b1d21f4f29ba97bcc9677dacf385a'
AND (
token = 'anxdXNj2EkJLYxpwSM0pFz9gDq7gnBjxmbtpMTsUN3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)