UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y471T92leHHYDPrKgNz4x5UAT3mAOKXSCJifB2gQEmU=' 
WHERE 
  key_id = '25bd637afa89f7e447cd9d2139cd3135cccf592e7958f5a5b9cfc061ec0d3bea' 
  AND (
    token = 'y471T92leHHYDPrKgNz4x5UAT3mAOKXSCJifB2gQEmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040