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