UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kVPTWH3OMYXRY+f8MdzR7Ko6U1y9yCIVOHm7pnlJrYw='
WHERE
key_id = '5a89006f335ba1e676181dfc752639ccd5b8f654f3e924d819ebfe8f3efe8cfd'
AND (
token = 'kVPTWH3OMYXRY+f8MdzR7Ko6U1y9yCIVOHm7pnlJrYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)