UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c7z/aYKl+WEx7L1QFqgc+QUpvtqFZzbMjQXlzG223LU=' 
WHERE 
  key_id = '142b0b2488f25ebcd8595e77cd62f9f01a84b1304d1acabc9bcd1ce71f4819ed' 
  AND (
    token = 'c7z/aYKl+WEx7L1QFqgc+QUpvtqFZzbMjQXlzG223LU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033