UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iHolrkuuqSn3W7IIiHbc/GvF4VPWYpOHrtsyPAQqPQY=' 
WHERE 
  key_id = '360b0f44c69d24e0ec9c3310959d7e3937a95443397d03c4c0d392ffa1ba3863' 
  AND (
    token = 'iHolrkuuqSn3W7IIiHbc/GvF4VPWYpOHrtsyPAQqPQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037