UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dhp3oxAfRBr6UrpDwxLE2ElN7LEzr2F5nT2kvvD4Tmg=' 
WHERE 
  key_id = '2831935bbd36e3003873536820f90efe004cd9d95401c644e8fae57e4ea4bd1f' 
  AND (
    token = 'Dhp3oxAfRBr6UrpDwxLE2ElN7LEzr2F5nT2kvvD4Tmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062