UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NyzxDyrbFybxouJWQWKA9vlkE477ivYqsKw1X15RUdQ='
WHERE
key_id = 'c2a2534fb213d4cccddb19aa77add57c6596dad65bb4b2e0859c0909dfbc0a46'
AND (
token = 'NyzxDyrbFybxouJWQWKA9vlkE477ivYqsKw1X15RUdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)