UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8naQJxx6KieDuRZzAq+sMSUd/q6Ca/vUutiQ9BdKExE=' 
WHERE 
  key_id = '1dd1afdeca9e1d308ddc59e1b279a76a88ea246734da2f1811698f144371b9d3' 
  AND (
    token = '8naQJxx6KieDuRZzAq+sMSUd/q6Ca/vUutiQ9BdKExE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035