UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OHwE9Cq42swm6QiHXHOuutNynW5/IAQsWSSVGY5xPm4=' 
WHERE 
  key_id = '3b8ce0692182008decfc054b47d6ba0cf4c42a7d4ec24af8b8bcf0438b19b877' 
  AND (
    token = 'OHwE9Cq42swm6QiHXHOuutNynW5/IAQsWSSVGY5xPm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00093