UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R5eSi2Cg+zIMOd/SVo1pq4VOonl85ONJizzqZIwGsj8=' 
WHERE 
  key_id = 'c8a05b58fbfd6bf69ce450ebf1a533da3b02ab6a1e8e80d7a4c4840a1e862fae' 
  AND (
    token = 'R5eSi2Cg+zIMOd/SVo1pq4VOonl85ONJizzqZIwGsj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027