UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZDSqxBuMaQu0kD6R/xn05/7m8bhRfPvWJqrvz6+PKkY=' 
WHERE 
  key_id = 'fea7b79b3018bb55244d59be7af17744e9732bba9f6e9af1cf14c4cbbd78ccc0' 
  AND (
    token = 'ZDSqxBuMaQu0kD6R/xn05/7m8bhRfPvWJqrvz6+PKkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027