UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '78j/jk5ZgqCFWf0W6txTC4zLAbsQu85y9EdTY7u3wow=' 
WHERE 
  key_id = '61e9a45e24d4ada496c39e874c3430a2df81a92389b7cc5f928dc684d21614e7' 
  AND (
    token = '78j/jk5ZgqCFWf0W6txTC4zLAbsQu85y9EdTY7u3wow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025