UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EAUsEytpwMXLZUBKX/7AVzxUlUafoyJ0toDAMaogYQ0='
WHERE
key_id = '21e3a9e999a46ce9cd3b33f3fe2f897a15a0dfe63dd97d4608a914c18f7b8e72'
AND (
token = 'EAUsEytpwMXLZUBKX/7AVzxUlUafoyJ0toDAMaogYQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)