UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pzDZRhWD4oVZqm93dR3GtWQ+aOMCAMHZ2ZNadpal6mY='
WHERE
key_id = 'dcf83c607e33b3b0d19d432e5c5bbcbabae72733fa5d075aeed9c3849f5c4112'
AND (
token = 'pzDZRhWD4oVZqm93dR3GtWQ+aOMCAMHZ2ZNadpal6mY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)