UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2/RIpUydOazLAAKEdiaLnLb0cYp7D8EHYcSxK5SoWcI=' 
WHERE 
  key_id = '2fe035d969575d1dd80aa9306da0bc9a9a6e540530b45d5444914b576b53ddb5' 
  AND (
    token = '2/RIpUydOazLAAKEdiaLnLb0cYp7D8EHYcSxK5SoWcI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026